<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* 
* Module default for frontpage
* @author DANG DINH HUNG
*
*/
class News extends Public_Controller
{
	
	public function __construct()
	{
		parent::__construct();
		breadcumb_reset();
	//	breadcumb(1,array(language_translate('breadcumb_news') , '#'));
	}
	 
	public function index()
	{
		$this->template->title( language_translate('brower_title_newspage') );
		$this->template
			->build('index');
	}

	function page(){
	    if( !in_array( $this->uri->segment(1),available_language_code()) AND $this->uri->segment(1) != $_SESSION['sys_lang_code']){
            $query = $_SERVER['QUERY_STRING'] ? '?'.$_SERVER['QUERY_STRING'] : '';
            redirect(site_url_lang(detect_uri($this->uri->uri_string().$query)));
        }
		$cat_name = $this->uri->segment(3);
		/**
			$cat = '';
			switch($cat_name){
				case 'announce':
					$cat = 'Announce page';
					break;
				case 'agencia':
					$cat = 'Agency page';
					break;
				case 'terms_conditions':
					$cat = 'Terms And Conditions';
					break;	
				case 'aviso_legal':
					$cat = 'Aviso legal';
					break;
				case 'politica_de_privacidad':	
					$cat = 'Politica de privacidad';
					break;
				case 'help':
					$cat = 'Help page';
					break;
				case 'fotografo':
					$cat = 'Fotografo';
					break;
			}
		**/
		$this->template->title(ucfirst(str_replace( array('-','_'),array(' ',' '),$cat_name)));
		$this->template->build('page', array('cat_name'=>$cat_name));
	}
//endclass	
}	